<?php

/* **************************************************************************
File:					admin.estategent.html.php
EstateAgent Improved - a Joomla Component
Copyright:			2004 - 2006 by Darko Selesi

Year: 2007
Improved by: Manos Orfanoudakis - "vosk"
Homepage: 		http://www.eaimproved.eu
Version: 			1.3.x                     
License:			GNU/GPL http://www.gnu.org/copyleft/gpl.html
*************************************************************************** */

// ensure this file is being included by a parent file
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

if (!($acl->acl_check( 'administration', 'edit', 'users', $my->usertype, 'components', 'all' ) || $acl->acl_check( 'administration', 'edit', 'users', $my->usertype, 'components', 'com_estateagent' ))) {
        mosRedirect( 'index2.php', _NOT_AUTH );
}

class HTML_estateagent {

 	function showObjOverview($option,$act,$obj,$pageNav) {
    	global $mosConfig_absolute_path, $mosConfig_live_site,$eaconf;
		mosCommonHTML::loadOverlib();
 		?>


		<form action="index2.php" method="post" name="adminForm" id="adminForm">
        <input type="hidden" name="option" value="<?php echo $option; ?>" />
		<input type="hidden" name="act" value="<?php echo $act; ?>" />
		<input type="hidden" name="task" value="" />		
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="hidemainmenu" value="0" />
       
		<?php echo        EAadmin::filterBar($pageNav->getLimitbox()); ?>
        <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist">
        <tr>
			<th width="15" class="title">#</th>
     		<th width="10" class="title"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $obj ); ?>);" /></th>
			<th width="50px" class="title"><?php echo _EAB_OBJ_OVW64; ?></th>
            <th width="80" class="title"><?php echo _EAB_OBJ_OVW1; ?></th>
            <th width="30%" class="title"><?php echo _EAB_OBJ_OVW2; ?></th>
            <th width="25%" class="title"><?php echo _EAB_OBJ_OVW3; ?></th>
            <th class="title"><?php echo _EAB_OBJ_OVW4; ?></th>
            <th width="90px" class="title"><?php echo _EAB_OBJ_OVW62; ?></th>
			<th class="title" align="center"><?php echo _EAB_OBJ_OVW61; ?></th>            
            <th class="title" align="center"><?php echo _EAB_OBJ_OVW6; ?></th>
            <th class="title" align="center"><?php echo _EAB_OBJ_OVW5; ?></th>
        </tr>
		<?php
        	$k = 0;
        	$i = 0;	
			foreach($obj as $o) {			
				$link   = 'index2.php?option=com_estateagent&act=manageObj&task=edit&hidemainmenu=1&id='. $o->id;
				$access = mosCommonHTML::AccessProcessing( $o, $i );
			?>
               	<tr class="<?php echo "row$k"; ?>">
               		<td width="15"><?php echo $pageNav->rowNumber( $i );?></td>
				
                   	<td width="10">
                    <?php 
					 echo mosCommonHTML::CheckedOutProcessing( $o, $i );
					/*
					
                    <input type="checkbox" id="cb<?php echo $i; ?>" name="cid[]" value="<?php echo $o->id; ?>" onClick="isChecked(this.checked);" />*/
					?>
                    </td>
							<?php
						$o->image = EAImage::load_firstPic($o->id, $eaconf->ea_picpath, 50);
						
					?>
					<td align="center"><a href="<?php echo $link;?>"><?php echo $o->image; ?></a></td>
                   	<td width="80" align="center"><?php echo $o->obj_id; ?></td>
                   	<td width="30%"><a href="<?php echo $link;?>" ><?php echo $o->title; ?> </a></td>
                   	<td width="25%"><?php /*
                   		echo ($o->country != "")? $o->country . " / " : "";
                   		echo ($o->locstate != "")? $o->locstate . " / " : "";
                   		echo ($o->town != "")? $o->town . " / " : "";
                   		echo ($o->district != "")? $o->district : ""*/
						echo EAObject::parseShortInfo($o);
	               		?></td>
                   	<td><?php echo $o->catname; ?></td>
					<td><?php echo $access;?></td>
				
					<td align="center"><?php
					if($o->hot == 1) echo '<img src="images/tick.png" width="12" height="12" border="0" alt="" />'; ?></td>
					<td align="center"><?php echo $o->hits; ?></td>
					
					<?php
                	$todate = date( "Y-m-d" );
                	if ((($o->publish_up >= $todate) && $o->publish_down == $todate || $o->publish_down == "0000-00-00") && $o->published == "1") {
                   		$img = 'publish_g.png'; # published and is current
                	} elseif ((($o->publish_up <= $todate) && $o->publish_down >= $todate || $o->publish_down == "0000-00-00") && $o->published == "1") {
                   		$img = 'publish_g.png'; # published and is current
	            	} elseif ($o->publish_up > $todate && $o->published == "1") {
                   		$img = 'publish_y.png'; # published, but is Pending
                	} elseif ($o->publish_down < $todate && $o->published == "1") {
                   		$img = 'publish_r.png'; # Published, but has Expired
                	} elseif ($o->published == "0") {
                   		$img = "publish_x.png"; # not Published
                	}
	            	$task = $o->published ? 'unpublish' : 'publish';
      				?>				
					<td align="center"><a href="javascript: void(0);" onclick="return listItemTask('cb<?php echo $i;?>','<?php echo $task;?>')"><img src="images/<?php echo $img; ?>" width="12" height="12" border="0" alt="" /></a></td>
				</tr>
				<?php
         		$k = 1 - $k; $i++;
				}
			
			?>
	        <tr>
               	<th colspan="11" align="center"><?php 
				echo $pageNav->writePagesLinks(); ?></th>
            </tr>
            <tr>
               	<td colspan="11" align="center"><?php echo $pageNav->writePagesCounter(); ?><br /><?php mosCommonHTML::ContentLegend(); ?></td>
            </tr>
			<tr><td colspan="11" align="center"><?php backendFooter(); ?></td></tr>
		</table>		
		</form>
   	<?php
	
 }
 	function editObj($option,$act,$action,$obj,$gl,$lists,$params) {
 		global $mosConfig_live_site, $mosConfig_absolute_path,$my,$eaconf;
        
		mosCommonHTML::loadOverlib();
        mosCommonHTML::loadCalendar();
        ?>
        <script language="javascript" type="text/javascript">
        	<!-- 
			
        	function submitbutton(pressbutton) {
      			if( pressbutton == 'media' ) {				
					popupWindow('index3.php?option=com_estateagent&act=gallery&objid=<?php echo $obj->id;?>','EstateAgent',750,580,'no');
					
				}			
				if ( pressbutton == 'cancel' ) {
        				submitform( pressbutton );
        				return;
      			}				
				if( pressbutton == 'save' || pressbutton == 'apply') {
					
					var form = document.adminForm;
					   			
      				if (form.cat.value == 0){
      					alert( "<?php echo _EAB_OBJ_ERROR31; ?>" );
					} else if (form.type.value == 0 ) {
						alert ("<?php echo _EAB_OBJ_TYPE_ERROR; ?>");      	   		
      	   			} else if (form.title.value.length < 5){
        				alert( "<?php echo _EAB_OBJ_ERROR2; ?>" );
      				} else if (form.title.value.length > 254){
        				alert( "<?php echo _EAB_OBJ_ERROR3; ?>" );        		
        			} else if (form.town.value == ""){
        				alert( "<?php echo _EAB_OBJ_ERROR12; ?>" );
            		} else if (form.country.value == ""){
        				alert( "<?php echo _EAB_OBJ_ERROR13; ?>" );
                	} else if (form.publish_down.value != "0000-00-00" && form.publish_up.value > form.publish_down.value ){
        				alert( "<?php echo _EAB_OBJ_ERROR14; ?>" );
                	} else {        			
        					<?php getEditorContents( 'editor1', 'description') ; ?>
                			<?php getEditorContents( 'editor2', 'location') ; ?>
                			<?php getEditorContents( 'editor3', 'condition') ; ?>
                			<?php getEditorContents( 'editor4', 'other') ; ?>
							
							
							
							submitform( pressbutton );
      				}
				}
    	}	
    	
        function changeGUI(tp) {    		 		
  			
			/*** Single-Type ***/
  			t1a = document.getElementById('type1a'); t1b = document.getElementById('type1b');
  			/*** Multi-Type ***/	 
  			t2b = document.getElementById('type2b');
  			t2c = document.getElementById('type2c'); t2d = document.getElementById('type2d');
  			/*** For Rent ***/
  			t3a = document.getElementById('type3a');	 	
  			/*** For Sale ***/
  			t4a = document.getElementById('type4a');
  			t4b = document.getElementById('type4b'); 			
  			
			/** current type **/
			ctp = document.getElementById('type').selectedIndex;
			warning = document.getElementById('warn');
			
			if(tp == null && ctp == 0 ){
				warning.style.display = "block"; 
			}
			else{
				warning.style.display = "none"; 
			}
			if(tp == 1) {
  				/*** Single-Type  For Rent ***/
				t1a.style.display = "block"; t1b.style.display = "block";
  				t2b.style.display = "none";
  				t2c.style.display = "none"; t2d.style.display = "none";  				
  				t3a.style.display = "block";
				t4a.style.display = "none"; t4b.style.display = "block";	
  			}
  			if(tp == 2) {
  				/*** Single-Type  For Sale ***/  								
  				t1a.style.display = "block"; t1b.style.display = "block";
				t2b.style.display = "none";
  				t2c.style.display = "none"; t2d.style.display = "none";
				t3a.style.display = "none";  					
  				t4a.style.display = "block"; t4b.style.display = "none";
  			}
  			if(tp == 3) {
  				/*** Multi-Type For Rent ***/
  				t1a.style.display = "none"; t1b.style.display = "none";					
  				t2b.style.display = "block";
  				t2c.style.display = "block"; t2d.style.display = "block";
  				t3a.style.display = "block";
				t4a.style.display = "none"; t4b.style.display = "block";
  			}
  			if(tp == 4) {
  				/*** Multi-Type For Sale ***/
  				t1a.style.display = "none"; t1b.style.display = "none";					
  				t2b.style.display = "block";
  				t2c.style.display = "block"; t2d.style.display = "block";
				t3a.style.display = "none"; 				
  				t4a.style.display = "block"; t4b.style.display = "none";
  			}
        }	
		//-->
		</script>

        <form action="index2.php" method="post" name="adminForm">
        <input type="hidden" name="option" value="<?php echo $option;?>" />
        <input type="hidden" name="act" value="<?php echo $act;?>" />
		<input type="hidden" name="task" value="" />                
        <input type="hidden" name="id" value="<?php echo $obj->id;?>" />             	
        <span class="sectionname"><?php echo $action; ?></span><br /><br />
		
        <table width="100%" border="0" cellpadding="0" cellspacing="2">
        <tr>
        	<td width="65%" valign="top">
        	<?php
        	$tabs1 = new mosTabs(0);
        	$tabs1->startPane("content-pane");
        	$tabs1->startTab(_EAB_OBJ_EOVW, "overview-page");
        	?>
        	<table width="100%" border="0" cellspacing="0" cellpadding="4" class="adminform">
        	<tr>
	        	<th colspan="2" class="title"><?php echo _EAB_OBJ_EDCPT; ?></th>
        	</tr>
        	<tr>
    			<td width="20%"><strong><?php echo _EAB_OBJ_ERFCNR; ?></strong></td>
            	<td width="80%"><input type="text" name="obj_id" size="15" class="inputbox" maxlength="25" value="<?php echo $obj->obj_id; ?>" /></td>
        	</tr>
        	<tr>
           		<td><b><?php echo _EAB_OBJ_ECAT; ?> / Type</b></td>
            	<td><?php  echo mosEAHTML::catSelectList('cat', 'class="inputbox" size="1" ',$obj->cat); ?>&nbsp;<?php echo $lists['type']; ?>&nbsp;&nbsp;<?php $tip=_EAB_OBJ_TYPE0; echo mosToolTip(htmlentities($tip,ENT_QUOTES,"UTF-8")); ?></td>
        	</tr>		
			<tr>
           		<td colspan="2">&nbsp;</td>
        	</tr>
			<tr>
        		<td><b><?php echo _EAB_OBJ_ETTL; ?></b></td>
            	<td><input type="text" name="title" size="50" class="inputbox" maxlength="100" value="<?php echo $obj->title; ?>" /></td>
        	</tr>
        	<tr>
        		<td valign="top"><b><?php echo _EAB_OBJ_EDCPT; ?></b></td>
            	<td>
            	<?php
			 		editorArea( 'editor1', $obj->description , 'description', '100%','250','70','10' );
				?>
            	</td>
        	</tr>
        	<tr>
           		<td valign="top"><b><?php echo _EAB_OBJ_ELCTN; ?></b></td>
            	<td>
            	<?php
			 		editorArea( 'editor2', $obj->location, 'location', '100%', '250', '70', '10' ) ;
				?>            	
            	</td>
        	</tr>
        	<tr>
           		<td valign="top"><b><?php echo _EAB_OBJ_ECNTN; ?></b></td>
            	<td>
            	<?php
			 		editorArea( 'editor3', $obj->condition , 'condition', '100%', '250', '70', '10' ) ;
				?>            	
            	</td>
        	</tr>
        	<tr>
           		<td valign="top"><b><?php echo _EAB_OBJ_EOTHR; ?></b></td>
            	<td>
            	<?php
			 		editorArea( 'editor4', $obj->other , 'other', '100%', '250', '70', '10' ) ;
				?>            	
            	</td>
	    	</tr>
        	</table>
        	<?php
        	$tabs1->endTab();
        	$tabs1->startTab(_EAB_OBJ_EEXP, "expose-page");
        	?>			
			<style type="text/css">
				div.warn { display:none; clear:left; text-align:center; width:98%; padding:5px;
								color:red; border:dashed 1px red; background-color:#ffeded; }
				div.tr1 { display:none; clear:left; width:100%; padding:5px; }
				div.tr2 { display:block; clear:left; width:100%; padding:5px; }
				div.td1 { display:inline; float:left; width:20%; height:18px; padding-top:4px; padding-bottom:0px; }
				div.td2 { display:inline; float:left; width:25%; height:20px; }
			</style>			
			<table width="100%" border="0" cellspacing="0" cellpadding="4" class="adminform">
        	<tr>
            		<th width="100%" colspan="5"><?php echo _EA_OBJ_DATA; ?></th>
        	</tr>
			<tr>
				<td colspan="5">
					<div id="warn" class="warn">
						<div><img src="<?php echo $mosConfig_live_site;?>/components/com_estateagent/pictures/gui/important.png" width="22px" height="22px" border="0"><br /><?php echo _EAB_OBJ_TYPE_ERROR; ?></div>
					</div>
					<div id="type1a" class="tr1">
						<div class="td1"><b><?php echo _EAB_OBJ_ENRRMS; ?></b></div>
						<div class="td2"><input type="text" name="rooms" size="5" class="inputbox" maxlength="5" value="<?php echo $obj->rooms; ?>" /></div>
						<div class="td1"><b><?php echo _EAB_OBJ_EDWGN; ?></b></div>
						<div class="td2"><input type="text" name="space" size="7" class="inputbox" maxlength="10" value="<?php echo $obj->space; ?>" />&nbsp;<?php echo $params['measure'];?></div>
					</div>

					<div id="type1b" class="tr1">
						<div class="td1"><b><?php echo _EAB_OBJ_BEDROOMS; ?></b></div>
						<div class="td2"><input type="text" name="bedrooms" size="5" class="inputbox" maxlength="4" value="<?php echo $obj->bedrooms; ?>" /></div>
						<div class="td1"><b><?php echo _EAB_OBJ_WC; ?></b></div>
						<div class="td2"><input type="text" name="wc" size="5" class="inputbox" maxlength="4" value="<?php echo $obj->wc; ?>" /></div>
					</div>

					<div id="type2b" class="tr1">
						<div class="td1"><b><?php echo _EAB_OBJ_EHMS; ?></b></div>
						<div class="td2"><input type="text" name="homes" size="5" class="inputbox" maxlength="5" value="<?php echo $obj->homes; ?>" /></div>
						<div class="td1"><b><?php echo _EAB_OBJ_ETUTS; ?></b></div>
						<div class="td2"><input type="text" name="trade_units" size="5" class="inputbox" maxlength="5" value="<?php echo $obj->trade_units; ?>" /></div>
					</div>
					<div id="type2c" class="tr1">
						<div class="td1"><b><?php echo _EAB_OBJ_EHMSS; ?></b></div>
						<div class="td2"><input type="text" name="homes_size" size="7" class="inputbox" maxlength="10" value="<?php echo $obj->homes_size; ?>" />&nbsp;<?php echo $params['measure'];?></div>
						<div class="td1"><b><?php echo _EAB_OBJ_ETUSZ; ?></b></div>
						<div class="td2"><input type="text" name="trade_size" size="7" class="inputbox" maxlength="10" value="<?php echo $obj->trade_size; ?>" />&nbsp;<?php echo $params['measure'];?></div>
					</div>
					<div id="type2d" class="tr1">
						<div class="td1"><b><?php echo _EAB_OBJ_EPPSZ; ?></b></div>
						<div class="td2"><input type="text" name="pp_size" size="7" class="inputbox" maxlength="10" value="<?php echo $obj->pp_size; ?>" />&nbsp;<?php echo $params['measure'];?></div>
					</div>
				
					<div class="tr2">
						<div class="td1"><b><?php echo _EAB_OBJ_EPSTN; ?></b></div>
						<div class="td2"><input type="text" name="position" size="15" class="inputbox" maxlength="25" value="<?php echo $obj->position; ?>" /></div>
						<div class="td1"><b><?php echo _EAB_OBJ_ELFT; ?></b></div>
						<div class="td2"><?php echo $obj->lift; ?></div>
					</div>
					
					<div class="tr2">
						<div class="td1"><b><?php echo _EAB_OBJ_EYOBLT; ?></b></div>
						<div class="td2"><input type="text" name="yobuilt" size="7" class="inputbox" maxlength="5" value="<?php echo $obj->yobuilt; ?>" /></div>
						<div class="td1"><b><?php echo _EAB_OBJ_HANDICAP; ?></b></div>
						<div class="td2"><?php echo $obj->handicap; ?></div>
					</div>
				
					<div class="tr2">
						<div class="td1"><b><?php echo _EAB_OBJ_ETOHT; ?></b></div>
						<div class="td2"><input type="text" name="toheat" size="15" class="inputbox" maxlength="50" value="<?php echo $obj->toheat; ?>" /></div>
						<div class="td1"><b><?php echo _EAB_OBJ_ETOHTUF; ?></b></div>
						<div class="td2"><?php echo $obj->toheat_ufloor; ?></div>
					</div>
					<div class="tr2">
						<div class="td1"><b><?php echo _EAB_OBJ_FIRESIDE; ?></b></div>
						<div class="td2"><?php echo $obj->fireside; ?></div>
						<div class="td1"><b><?php echo _EAB_OBJ_AIRCONDITION; ?></b></div>
						<div class="td2"><?php echo $obj->aircondition; ?></div>
					</div>
					
					<div class="tr2">
						<div class="td1"><b><?php echo _EAB_OBJ_TV; ?></b></div>
						<div class="td2"><?php echo $obj->tv; ?></div>
						<div class="td1"><b><?php echo _EAB_OBJ_DSL; ?></b></div>
						<div class="td2"><?php echo $obj->dsl; ?></div>
					</div>

					<div class="tr2">
						<div class="td1"><b><?php echo _EAB_OBJ_EBLCY; ?></b></div>
						<div class="td2"><?php echo $obj->balcony; ?></div>
						<div class="td1"><b><?php echo _EAB_OBJ_ETRCE; ?></b></div>
						<div class="td2"><?php echo $obj->terrace; ?></div>
					</div>
				
					<div class="tr2">
						<div class="td1"><b><?php echo _EAB_OBJ_SWPOOL; ?></b></div>
						<div class="td2"><?php echo $obj->swpool; ?></div>
						<div class="td1"><b><?php echo _EAB_OBJ_EGRDNSZ; ?></b></div>
						<div class="td2"><?php echo $obj->garden; ?></div>
					</div>
				
					<div class="tr2">
						<div class="td1"><b><?php echo _EAB_OBJ_EPKAE; ?></b></div>
						<div class="td2"><?php echo $obj->parkarea; ?></div>
						<div class="td1"><b><?php echo _EAB_OBJ_EGRG; ?></b></div>
						<div class="td2"><?php echo $obj->garage; ?></div>
					</div>
				</td>
        	</tr>
        	<tr>
           		<td colspan="5">&nbsp;</td>
        	</tr>
        	<tr>
        		<th colspan="5" class="title"><b><?php echo _EAB_OBJ_EFNZI; ?></b></th>
        	</tr>
        	<tr>
           		<td colspan="5">
					<div id="type3a" class="tr1">
						<div class="td1"><b><?php echo _EAB_OBJ_ERNTC; ?></b></div>
						<div class="td2"><input type="text" name="rent" size="10" class="inputbox" maxlength="20" value="<?php echo $obj->rent; ?>" />&nbsp;<?php echo $params['currency']; ?></div>
						<div class="td1"><b><?php echo _EAB_OBJ_ERNTX; ?></b></div>
						<div class="td2"><input type="text" name="rent_extra" size="10" class="inputbox" maxlength="20" value="<?php echo $obj->rent_extra; ?>" />&nbsp;<?php echo $params['currency']; ?></div>
					</div>
				    <div id="type4a" class="tr1">
						<div class="td1"><b><?php echo _EAB_OBJ_EPRCE; ?></b></div>
						<div class="td2"><input type="text" name="price" size="10" class="inputbox" maxlength="20" value="<?php echo $obj->price; ?>" />&nbsp;<?php echo $params['currency']; ?></div>
						<div class="td1"><b><?php echo _EAB_OBJ_ERCPTSM; ?></b></div>
						<div class="td2"><input type="text" name="receipts" size="10" class="inputbox" maxlength="20" value="<?php echo $obj->receipts; ?>" />&nbsp;<?php echo $params['currency'];?></div>
					</div>       	
					
					<div id="type4a" class="tr2">
						<div class="td1"><b><?php echo _EAB_OBJ_ECMMSN; ?></b>&nbsp;<?php $tip = "Please add <b>%</b> or <b>&euro;</b>, when filling in the commission!";  echo mosToolTip(htmlentities($tip,ENT_QUOTES,"UTF-8")); ?></div>
						<div class="td2"><input type="text" name="commis" size="10" class="inputbox" maxlength="20" value="<?php echo $obj->commis; ?>" />&nbsp;( % / <?php echo $params['currency']; ?> ) </div>
					</div>
					<div id="type4b">	
						<div class="td1"><b><?php echo _EAB_OBJ_ESCRE; ?></b></div>
						<div class="td2"><input type="text" name="secure" size="10" class="inputbox" maxlength="20" value="<?php echo $obj->secure; ?>" />&nbsp;<?php echo $params['currency']; ?></div>
					</div>  
				</td>            
			</tr>
        	<tr>
           		<td colspan="5">&nbsp;</td>
        	</tr>
        	</table>
        	<table width="100%" border="0" cellspacing="0" cellpadding="4" class="adminform">
        	<tr>
            	<th colspan="4" class="title"><?php echo _EAB_OBJ_ELCTN1; ?></th>
        	</tr>
        	<tr>
           		<td width="20%"><b><?php echo _EAB_OBJ_ESTRNR; ?></b></td>
            	<td width="45%"><input type="text" name="street" size="29" class="inputbox" maxlength="100" value="<?php echo $obj->street; ?>" />&nbsp;<input type="text" name="streetnr" size="5" class="inputbox" maxlength="10" value="<?php echo $obj->streetnr; ?>" /></td>
           		<td colspan="2"></td>
        	</tr>
        	<tr>
           		<td><b><?php echo _EAB_OBJ_EPCTWN; ?></b></td>
            	<td><input type="text" name="pcode" size="6" class="inputbox" maxlength="10" value="<?php echo $obj->pcode; ?>" />&nbsp;<input type="text" name="town" size="28" class="inputbox" maxlength="100" value="<?php echo $obj->town; ?>" /></td>
          		<td colspan="2"></td>
        	</tr>
        	<tr>
          		<td><b><?php echo _EAB_OBJ_EDSCT; ?></b></td>
            	<td><input type="text" name="district" size="35" class="inputbox" maxlength="100" value="<?php echo $obj->district; ?>" /></td>
           		<td colspan="2"></td>
        	</tr>
        	<tr>
           		<td><b><?php echo _EA_OBJ_STATE; ?></b></td>
            	<td><input type="text" name="locstate" size="35" class="inputbox" maxlength="100" value="<?php echo $obj->locstate; ?>" /></td>
           		<td colspan="2"></td>
        	</tr>
        	<tr>
         		<td><b><?php echo _EAB_OBJ_ECNTR; ?></b></td>
            	<td><?php echo $lists['countries']; ?></td>
           		<td colspan="2"></td>
        	</tr>
        	</table>
        	<script language="javascript" type="text/javascript">
        		changeGUI(<?php echo $obj->type; ?>);
        	</script>
        	<?php
        	$tabs1->endTab();
        	$tabs1->startTab(_EAB_OBJ_IMAGES, "images-page");
        	?>
        	<table width="100%" border="0" cellspacing="0" cellpadding="4" class="adminform">        
        	<tr>
        		<th class="title" colspan="2"><?php echo _EAB_OBJ_IMAGES_PREVIEW; ?></th>
        	</tr>
        	<?php
        		echo $gl;
        	?>
        	</table>
        	<?php
        $tabs1->endTab();
		
		if($eaconf->ea_googlemap_enable==1){
	
 			$tabs1->startTab('GoogleMap', "googlemap-page");
			GMapFunctions::adminPane("adminForm",$obj->mapcoords);
			$tabs1->endTab();

		}
       $tabs1->endPane();
  		?>
  		</td>
        <td width="35%" valign="top">
        <?php
        $tabs2 = new mosTabs(0);
        $tabs2->startPane("param-pane");
        $tabs2->startTab(_EAB_OBJ_EPBLSH, "publish-page");
        ?>
        <table width="100%" border="0" cellspacing="0" cellpadding="4" class="adminform">
        <tr>
        	<th colspan="2" class="title" ><?php echo _EAB_OBJ_EPBLSH1; ?></th>
        </tr>        
        <tr>
           	<td valign="top"><b><?php echo _EAB_HITCOUNTER; ?></b></td>
            <td><?php
				echo $obj->hits;
				if($obj->hits > 0) {
					$link	= "index2.php?option=com_estateagent&act=manageObj&task=resetC&hidemainmenu=1&id=".$obj->id;
					echo "&nbsp;&nbsp;<input type=\"button\" class=\"button\" value=\""._EAB_OBJ_RESETCNT."\" onClick=\"javascript:document.location.href='$link'\" />";
				} ?></td>
        </tr>
        <tr>
           	<td><b><?php echo _EAB_OBJ_CHANGE_OWNER; ?></b></td>
            <td><?php echo $lists['created_by']; ?></td>
        </tr>
		<tr>
           	<td valign="top"><b><?php echo _EAB_CFG_STS05; ?></b></td>
            <td><?php echo $lists['access']; ?></td>
        </tr>
        <tr>
           	<td><b><?php echo _EAB_OBJ_CRTD; ?></b></td>
            <td><?php echo $obj->created; ?></td>
        </tr>        
        <tr>
        	<td><b><?php echo _EAB_OBJ_EPBLSHST; ?></b></td>
        	<td>
        		<input class="inputbox" type="text" name="publish_up" id="publish_up" value="<?php echo $obj->publish_up; ?>" size="25" maxlength="100" />
        		<input type="reset" class="button" value="..." onClick="return showCalendar('publish_up', 'yyyy-mm-dd');">
        	</td>
      	</tr>
        <tr>
        	<td><b><?php echo _EAB_OBJ_EPBLSHE; ?></b></td>
        	<td>
        		<input class="inputbox" type="text" name="publish_down" id="publish_down" value="<?php echo $obj->publish_down; ?>" size="25" maxlength="100" />
        		<input type="reset" class="button" value="..." onClick="return showCalendar('publish_down', 'yyyy-mm-dd');">
        	</td>
      	</tr>        
		<tr>
           	<td><b><?php echo _EAB_OBJ_EPHOT; ?></b></td>
            <td align="left"><?php echo $obj->hot; ?></td>
		</tr>
		<tr>
           	<td width="25%"><b><?php echo _EAB_OBJ_EPBLSHA; ?></b></td>
            <td width="75%" align="left"><?php echo $obj->published; ?></td>
		</tr>   
		</table>        
        <?php
 		backendFooter();
		$tabs2->endTab();
 		$tabs2->startTab('Meta Info', "meta-page");
        ?>
 		<table width="100%" border="0" cellspacing="0" cellpadding="4" class="adminform">
        <tr>
        	<th colspan="2" class="title"><?php echo _EAB_OBJ_METAINFO; ?></th>
        </tr>       
        <tr>
        	<td width="20%" valign="top"><b><?php echo _EAB_OBJ_METAKEYS;?></b></td>
        	<td width="80%"><textarea name="metakey" cols="28" rows="2"><?php echo $obj->metakey; ?></textarea></td>
 		</tr>
 		<tr>
           	<td valign="top"><b><?php echo _EAB_OBJ_METADESC;?></b></td>
            <td><textarea name="metadesc" cols="28" rows="3"><?php echo $obj->metadesc; ?></textarea></td>
        </tr>
 		</table>
 		<?php
 		backendFooter();
		$tabs2->endTab();
		$tabs2->endPane();
 		?>
 		</td>
 	</tr>
 	</table>
 	</form>
   <?php	
 }

	function showCatOverview($option, $act,$total,$hidden) {
		global $database;
		
		?>
		<form action="index2.php" method="post" name="adminForm">
    	<input type="hidden" name="option" value="<?php echo $option;?>" />	
		<input type="hidden" name="act" value="<?php echo $act;?>" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="hidemainmenu" value="0" />
        <?php
		if($hidden>0){
			?>
           <div align="center"><span style="color: #FF0000;font-weight: bold;text-decoration:blink;" >Warning!!! Some published subcategories are invisible!</span></div>           
            
            

		
		<?php
			}
		
		?>
    	<div style="text-align:right"><input type="checkbox"  <?php echo ( mosGetParam( $_REQUEST, 'catrecurse', 0 )==1)?" checked ":""?>  value="1" name="catrecurse"/><b>Apply changes to the rest of the subtree</b></div>
        <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist">
        
        <tr>
			<th width="2%" class="title" align="center">#</th>
      		<th width="3%" class="title" align="center"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo $total; ?>);" /></th>
        	<th width="30%" class="title" align="center"><?php echo _EAB_CAT_OVW2; ?></th>
            <!-- <th width="50px" class="title"><?php echo _EAB_CAT_OVW31; ?></th> -->
        	<th class="title" width="30%" align="center"><?php echo _EAB_CAT_OVW3; ?></th>
        	<th class="title"  align="left"><?php echo _EAB_OBJ_OVW62;?></th>
			
			<th width="50px" class="title" align="center"><?php echo _EAB_OBJ_OVW63;?></th>
        	<th width="50px" class="title" align="center"><?php echo _EAB_CAT_OVW4; ?></th>
    	</tr>
		<?php
			$r=0;
			HTML_estateagent::catOverRecursive($r,0,"",1);
			?>
        <tr>
    		<th colspan="8" align="center"></th>
    	</tr>
    	<tr>
    		<td colspan="8" align="center"><?php mosCommonHTML::ContentLegend(); ?></td>
    	</tr>
		<tr><td colspan="8" align="center"><?php echo backendFooter();?> </td></tr>
    	</table>	
		</form>
	<?php

 	
	}
	function catOverRecursive(&$r,$parent,$indend,$pp){
		global $database;
		$query = "SELECT c.*, g.name AS groupname FROM #__estateagent_categories c"						
						. " LEFT JOIN #__groups g ON g.id = c.access WHERE parent = $parent"
						. " ORDER BY  c.ordering ASC "; 	    
        $database->setQuery($query);
   		$cats= $database->loadObjectList();
		$c=0;
		$count=count($cats);
		//echo $count;
		foreach($cats as $cat){
			$up=1;
			$down=1;
			if($c==0){
				$up=0;
				}
			if($c+1==$count){
				$down=0;
				}
			
				$query = "SELECT count(id) FROM #__estateagent WHERE cat = $cat->id";		
    			$database->setQuery($query);
    			$entries = $database->loadResult();
				//if($pp==0)
				
				HTML_estateagent::catOvervRow($r,$indend."<sup>L</sup>&nbsp;&nbsp;",$cat,$entries,$up,$down,$pp);
			$r++;
			$c++;
			HTML_estateagent::catOverRecursive($r,$cat->id,$indend."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",$pp==0?$pp:$cat->published);			
		
		}
	
	
	}
	function catOvervRow($r,$indend,$cat,$entries,$up,$down,$pp){
		$link1		= ampReplace('index2.php?option=com_estateagent&act=manageCat&task=edit&hidemainmenu=1&id='. $cat->id);
		$access1 	= mosCommonHTML::AccessProcessing( $cat, $r );
	?>
   			 <tr >
    	       		<td><?php echo $r +1 ;?></td>
                	<td><input type="checkbox" id="cb<?php echo $r; ?>" name="cid[]" value="<?php echo $cat->id; ?>" onClick="isChecked(this.checked);" /></td>
                	<td align="left">
						
					<?php echo $indend;
						if($cat->published ==0){
							 $cat->name="<strong style=\"color:#999999\">".$cat->name.'</strong>';
							 if($entries>0)
								 $entries="<strong style=\"color:#FF0000;text-decoration:blink;\">".$entries.'</strong>';
							 }
						elseif($pp==0){
							$cat->name="<strong style=\"color:#FF0000;text-decoration:blink;\">".$cat->name.'</strong>';
							if($entries>0)
								$entries="<strong style=\"color:#FF0000;text-decoration:blink;\">".$entries.'</strong>';
							}
					?>	

                    <a href="<?php echo $link1;?>"><?php echo $cat->name; ?></a>
                      <?php  	
        			if($up==1) {
        				echo "<a href='#reorder' onClick='return listItemTask(\"cb".$r."\",\"orderup\")' title='Move Up'>";
        				echo "<img src='images/uparrow.png' width='12' height='12' border='0' alt=" . _EAB_OBJ_EGLPUP . "></a>&nbsp;";
        			}
        			if($down==1) {
        				echo "<a href='#reorder' onClick='return listItemTask(\"cb".$r."\",\"orderdown\")' title='Move Down'>";
        				echo "<img src='images/downarrow.png' width='12' height='12' border='0' alt=" . _EAB_OBJ_EGLPDW . "></a>";
        			}
        		    ?>  
                   
					
                    </td>
                    <!--<td style="text-align:center">
        				
        			</td>-->
                	<td align="left"><?php echo $cat->description; ?></td>
        			<td align="left"><?php echo $access1;?></td>
					
					<td style="text-align:center"><?php echo $entries;?></td>
        			<?php
                	$todate = date( "Y-m-d" );
                	if ((($cat->publish_up >= $todate) && $cat->publish_down == $todate || $cat->publish_down == "0000-00-00") && $cat->published == "1") {
                   		$img = 'publish_g.png'; # published and is current
                	} elseif ((($cat->publish_up <= $todate) && $cat->publish_down >= $todate || $cat->publish_down == "0000-00-00") && $cat->published == "1") {
                   		$img = 'publish_g.png'; # published and is current
	            	} elseif ($cat->publish_up > $todate && $cat->published == "1") {
                   		$img = 'publish_y.png'; # published, but is Pending
                	} elseif ($cat->publish_down < $todate && $cat->published == "1") {
                   		$img = 'publish_r.png'; # Published, but has Expired
                	} elseif ($cat->published == "0") {
                   		$img = "publish_x.png"; # not Published
                	}
	            	$task = $cat->published ? 'unpublish' : 'publish';
      				?>				
					<td align="center"><a href="javascript: void(0);" onclick="return listItemTask('cb<?php echo $r;?>','<?php echo $task;?>')"><img src="images/<?php echo $img;?>" width="12" height="12" border="0" alt="" /></a></td>
            	</tr>
    
    
    <?php
	
	}
	function catDelete($option,$act,$cids){
	
	?>
	 <form action="index2.php" method="post" name="adminForm" id="adminForm">    
    	<input type="hidden" name="option" value="<?php echo $option; ?>" />
    	<input type="hidden" name="act" value="<?php echo $act; ?>" />
		<input type="hidden" name="task" value="performremove" />
    	<input type="hidden" name="cids" value="<?php echo $cids; ?>" />
	
	<table  border="0" cellspacing="4" cellpadding="1">
          <tr>
            <th colspan="2"><div align="center"><span style="color: #FF0000;font-weight: bold;" >Warning!! All objects, inside  the categories you have selected, will be deleted!</span></div></th>
          </tr>
          <tr>
            <td style="text-align:right">Select an action for subcategories:</td>
            <td ><select name="subcats" id="select">
            <option value="0" selected>  Move one level up</option>
            <option value="1">  Delete recursively</option>
            
            </select>            </td>
          </tr>
          <tr>
            <td colspan="2" style="text-align:center"> <input type="submit" name="button" id="button" value="Continue" /></td>
          </tr>
        </table>
  

       

    </form>
    <?php
	
	}
	function editCat($option, $act, $cat, $lists) {
		global $mosConfig_live_site;   
		
		mosCommonHTML::loadOverlib();
        mosCommonHTML::loadCalendar();		
		?>
<script language="javascript" type="text/javascript">    	
    	function submitbutton(pressbutton) {
      		var form = document.adminForm;

            if (pressbutton == 'cancel') {
        			submitform( pressbutton );
        			return;
      			}
      		if (form.name.value == ""){
        		alert( "<?php echo _EAB_CAT_ERROR1;?>" );      	   	
      	   	} else {
        			<?php getEditorContents( 'editor1', 'description');?>
        			submitform( pressbutton );
        	}
    	}
    	</script>
		
    	<form action="index2.php" method="post" name="adminForm" id="adminForm">    
    	<input type="hidden" name="option" value="<?php echo $option; ?>" />
    	<input type="hidden" name="act" value="<?php echo $act; ?>" />
		<input type="hidden" name="task" value="" />
    	<input type="hidden" name="id" value="<?php echo $cat->id; ?>" />
    	
    	<?php
		
   		$action = ($cat->id != 0) ? _EAB_CAT_ECAT : _EAB_CAT_ENCAT;
  		?>
    	<span class="sectionname"><?php echo $action; ?></span><br /><br />
    	<table width="100%" border="0" cellspacing="4" cellpadding="1">
   		<tr>
			<td width="65%">

			<table width="100%" border="0" cellspacing="4" cellpadding="1" class="adminform">
   			<tr>
				<th class="title" colspan="2"></th>
			</tr>
			<tr>
   				<td><b><?php echo _EAB_CAT_ECHCAT; ?></b></td>
        		<td><?php echo $lists['parent'];?></td>
   			</tr>
			<tr>
   				<td><b><?php echo _EAB_SORT_OPT; ?></b></td>
        		<td><?php echo $lists['ordering'];?></td>
   			</tr>
   			<tr>
	    		<td><b><?php echo _EAB_CAT_ECNME; ?></b></td>
        		<td><input type="text" name="name" size="30" class="inputbox" maxlength="30" value="<?php echo $cat->name; ?>" /></td>
			</tr>			
			<tr>
        		<td valign="top"><b><?php echo _EAB_CAT_ECDSCPT; ?></b></td>
        		<td>
        		<?php
					editorArea( 'editor1', $cat->description, 'description', 500, 100, '70', '10' ) ;
				?>
        		</td>
    		</tr>    		
    		</table>    
    	</td>
		<td width="35%" valign="top">
			<table width="100%" border="0" cellspacing="4" cellpadding="1" class="adminform">
   			<tr>
				<th class="title" colspan="2"></th>
			</tr>			
			<tr>
   				<td valign="top"><b><?php echo _EAB_CFG_STS05; ?></b></td>
        		<td><?php echo $lists['access'];?></td>
   			</tr>
			<tr>
        		<td><b><?php echo _EAB_OBJ_EPBLSHST; ?></b></td>
        		<td>
        			<input class="inputbox" type="text" name="publish_up" id="publish_up" value="<?php echo $cat->publish_up; ?>" size="25" maxlength="100" />
        			<input type="reset" class="button" value="..." onClick="return showCalendar('publish_up', 'yyyy-mm-dd');">
        		</td>
      		</tr>
        	<tr>
        		<td><b><?php echo _EAB_OBJ_EPBLSHE; ?></b></td>
        		<td>
        			<input class="inputbox" type="text" name="publish_down" id="publish_down" value="<?php echo $cat->publish_down; ?>" size="25" maxlength="100" />
        			<input type="reset" class="button" value="..." onClick="return showCalendar('publish_down', 'yyyy-mm-dd');">
        		</td>
      		</tr>
			<tr>
    			<td><b><?php echo _EAB_CAT_ECPBLSH; ?></b></td>
        		<td><?php echo $lists['publish']; ?></td>
			</tr>
			</table>
			<?php echo backendFooter();?>
		</td>	
		</tr>
		</table>
		</form>
		<?php
		
}

// *****************************************************************************************
// Start Agents-Administration *********************************************************************
// *****************************************************************************************

function showAgents($option, $act, $result,$pageNav) {
	global $mosConfig_live_site;
	?>
	<div align="left"><a href="http://www.eaimproved.eu/" target="_blank"><img src="<?php echo $mosConfig_live_site; ?>/components/com_estateagent/gui/ealogo.png" alt="" border="0"></a></div>
    
    <form action="index2.php" method="post" name="adminForm">
    <input type="hidden" name="option" value="<?php echo $option; ?>" />
	<input type="hidden" name="act" value="<?php echo $act; ?>" />
	<input type="hidden" name="task" value="" />		
	<input type="hidden" name="boxchecked" value="0" />	
        
    <table cellpadding="4" cellspacing="0" border="0" width="100%">
    <?php 
       Menu_line();
    ?>
	<tr>
    	<td colspan="4" align="left">&nbsp;</td>        
        <td colspan="3" align="right" valign="bottom"><?php echo _EAB_OBJ_PP; ?>&nbsp;<?php echo $pageNav->writeLimitBox(); ?></td>
    </tr>
    <tr>
    	<td colspan="3" align="left">&nbsp;</td>
        <td colspan="4" align="right" valign="bottom"><b>Filter:</b>&nbsp;<input type="text" name="filter" value="<?php echo $filter;?>" class="inputbox" onChange="document.adminForm.submit();" />
            &nbsp;<?php echo $corder; ?>&nbsp;<b><?php echo _EAB_SORT_OPT . "</b>&nbsp;" . $sort; ?></td>
    </tr>        
    <tr>
    	<td colspan="7">&nbsp;</td>
    </tr>
	<tr>
       	<td colspan="7" align="center"><span class="sectionname"><?php echo _EAB_OBJ_OVW; ?></span></td>
    </tr>
    </table>
	
	<table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist">
        <tr>
			<th width="2%" class="title">#</th>
      		<th width="3%" class="title">&nbsp;</th>
            <th width="70px" class="title"><?php echo "Username"; ?></th>
            <th class="title" width="120px"><?php echo "Name"; ?></th>
            <th class="title"><?php echo "Address"; ?></th>
            <th width="17%" class="title"><?php echo "Email"; ?></th>
            <th width="50px" class="title" align="center"><?php echo "..."; ?></th>            
            <th width="30px" class="title" align="center"><?php echo "..."; ?></th>
            <th width="50px" class="title" align="center"><?php echo "..."; ?></th>
        </tr>
		<?php
        	$k = 0;
        	$l = 1;		
			for ($i=0, $n=count( $result ); $i < $n; $i++) {
 	              	$r = &$result[$i];
				
					$checked = mosCommonHTML::CheckedOutProcessing( $r, $i );
			?>
               	<tr class="<?php echo "row$k"; ?>">
               		<td><?php echo $pageNav->limitstart+$l; ?></td>
                   	<td><?php echo $checked; ?></td>
                   	<td><a href="#edit" onClick="return listItemTask('cb<?php echo $r->id;?>','edit')"><?php echo $r->name; ?></a></td>
                   	<td><a href="#edit" onClick="return listItemTask('cb<?php echo $r->id;?>','edit')"><?php echo $r->username; ?> </a></td>
                   	<td><?php echo $r->address . ', ' . $r->suburb . ', ' . $r->country; ?></td>
                   	<td><?php echo $r->email; ?></td>
					<td align="center"><?php
					if($o->hot == 1) echo '<img src="images/tick.png" width="12" height="12" border="0" alt="" />'; ?></td>
					<td align="center"><?php echo $o->hits; ?></td>
					
					
				</tr>
				<?php
         		$k = 1 - $k; $l++;
				}
			
			?>
	        <tr>
               	<th colspan="9" align="center"><?php echo $pageNav->writePagesLinks("index2.php?option=com_estateagent&act=$act&corder=$corder&sort=$sort"); ?></th>
            </tr>
            <tr>
               	<td colspan="9" align="center"><?php echo $pageNav->writePagesCounter(); ?></td>
            </tr>
	  </table>		
	</form>
	<?php
}


// *****************************************************************************************
// Start Configuration *********************************************************************
// *****************************************************************************************

	function configEA($lists){    
    	global $mosConfig_absolute_path, $mosConfig_live_site,$eaconf;
    	
		mosCommonHTML::loadOverlib();		
		?>    
    	<!-- Link script file to the HTML document in the header -->
		<script type="text/javascript" language="javascript" src="components/com_estateagent/includes/colorPicker/js/colorPicker.js"></script>
<link rel="stylesheet" href="components/com_estateagent/includes/colorPicker/css/colorPicker.css" type="text/css"></link>
		<table cellpadding="4" cellspacing="0" border="0" width="100%">
  		<tr>
    		<td colspan="7" align="center" class="sectionname"><span class="componentheading">configuration.php <?php echo _EAB_CFG_STS1;?>
    		<?php echo is_writable( $mosConfig_absolute_path . '/administrator/components/com_estateagent/configuration.php' ) ? '<b><span style="color:green">' . _EAB_CFG_STS102 . '</span></b>' : '<b><span sytle="color:red">' . _EAB_CFG_STS103 . '</span></b>'; ?>
			</span>
			</td>
  		</tr>
    	<tr>
    		<td colspan="7"><br /></td>
    	</tr>
		</table>
    
   		<form action="index2.php" method="POST" name="adminForm" id="adminForm">
    	<input type="hidden" name="option" value="com_estateagent" />
    	<input type="hidden" name="act" value="configEA" />
		<input type="hidden" name="task" value="save" />
        
    	<?php
    	$tabs = new mosTabs(0);
    	$tabs->startPane("config-pane");
    	$tabs->startTab(_EAB_CFG_STS3, "general-page");
    	?>
    	<table width="100%" border="0" cellspacing="0" cellpadding="4" class="adminform">
    	<tr>
			<th class="title" colspan="3">&nbsp;</th>
        </tr>
    	<tr>
      		<td width="20%"><?php echo _EAB_CFG_STS6; ?></td>
        	<td width="45%"><?php echo $lists['ea_offline']; ?></td>
        	<td width="35%">&nbsp;</td>
    	</tr>
		
        <tr>
      		<td width="20%"><?php echo _EAB_CFG_DISPERRORS; ?></td>
        	<td width="45%"><?php echo $lists['ea_disperrors']; ?></td>
        	<td width="35%">&nbsp;</td>
    	</tr>
    	<tr>
       		<td valign="top"><?php echo _EAB_CFG_STS7; ?></td>
        	<td><textarea name="ea_offmessage" rows="4" cols="38" class="text_area"><?php echo $lists['ea_offmessage']; ?></textarea></td>
        	<td>&nbsp;</td>
    	</tr>
    	<tr>
       		<td><?php echo _EAB_CFG_STS14; ?></td>
        	<td><?php echo $lists['ea_measure'];	?></td>
        	<td>&nbsp;</td>
    	</tr>
    	<tr>
    		<td><?php echo _EAB_CFG_STS15;  $tip=_EAB_CFG_STS16; //echo mosToolTip(htmlentities($tip,ENT_QUOTES,"UTF-8")); ?></td>
        	<td><input type="text" name="ea_currency" size="3" class="text_area" maxlength="50" value="<?php echo $lists['ea_currency'];  ?>" />&nbsp;<?php echo _EAB_CFG_DECIMALDIGITS ?>&nbsp;<input type="text" name="ea_currency_digits" size="1" class="text_area" maxlength="1" value="<?php echo $lists['ea_currency_digits']; ?>" /> </td>
            
            <td></td>
    	</tr>
      
    	<tr>
    		<td><?php echo _EAB_CFG_STS151; ?></td>
        	<td><?php echo $lists['ea_nformat'];	?></td>
        	<td>&nbsp;</td>
    	</tr>
        <tr>
    		<td><?php echo _EAB_CFG_CURRENCY_BERORE_PRICE; ?></td>
        	<td><?php echo $lists['ea_currency_pos'];	?></td>
        	<td>&nbsp;</td>
    	</tr>
		<tr>
       		<td valign="top"><?php echo _EAB_CFG_FOOTER; ?>&nbsp;&nbsp;<?php $tip=_EAB_CFG_FOOTER_INFO; echo mosToolTip(htmlentities($tip,ENT_QUOTES,"UTF-8")); ?></td>
        	<td ><?php echo $lists['ea_footer']; ?></td>
        	<td>&nbsp;</td>
    	</tr>   
			<tr>
       		<td valign="top">Template</td>
        	<td ><?php echo $lists['ea_template'];?></td>
        	<td>&nbsp;</td>
    	</tr>   
		<tr>
       		<td valign="top"><?php echo _EAB_CFG_NUMBER_RSS; ?></td>
        	<td ><input type="text" name="ea_rss" size="5" class="text_area" maxlength="5" value="<?php echo $lists['ea_rss']; ?>" />&nbsp;<?php echo _EAB_CFG_ZERODISABLE?></td>
        	<td>&nbsp;</td>
    	</tr> 
			     	
		</table>
		<?php
    	backendFooter();
		$tabs->endTab();    	
    	$tabs->startTab(_EAB_CFG_CATEGORIES, "cat-page");
    	?>
    	<table width="100%" border="0" cellspacing="0" cellpadding="4" class="adminform">
    	<tr>
	    	<th class="title" colspan="3">&nbsp;</th>
        </tr>    
    	<tr>
       		<td width="20%"><?php echo _EAB_CFG_STS18; ?></td>
        	<td width="45%"><?php echo $lists['ea_fpstyle']; ?></td>
        	<td width="35%">&nbsp;</td>
    	</tr>    
    	<tr>
       		<td><?php echo _EAB_CFG_STS19; ?></td>
        	<td><?php echo $lists['ea_show_scats']; ?></td>
        	<td>&nbsp;</td>
   		</tr> 
		<tr>
       		<td><?php echo _EAB_CFG_FULLCATVIEW; ?></td>
        	<td><?php echo $lists['ea_mcat_fullview']; ?></td>
        	<td>&nbsp;</td>
   		</tr>		   
    	<tr>
       		<td><?php echo _EAB_CFG_STS20; ?></td>
        	<td><?php echo $lists['ea_cat_entries']; ?></td>
        	<td>&nbsp;</td>
    	</tr>
		
		
    	</table>
		<?php
    	backendFooter();
		$tabs->endTab();
    	$tabs->startTab(_EAB_CFG_OBJECTS, "obj-page");
    	?>
		<table width="100%" border="0" cellspacing="0" cellpadding="4" class="adminform">
    	<tr>
			<th class="title" colspan="3">&nbsp;</th>
        </tr>    	
    	<tr>
       		<td width="20%"><?php echo _EAB_CFG_HOTONFP; ?></td>
        	<td width="45%"><?php echo $lists['ea_hotfp']; ?></td>
        	<td width="35%">&nbsp;</td>
    	</tr>
    	<tr>
       		<td><?php echo _EAB_CFG_HOTONFPAMOUNT; ?></td>
        	<td><?php echo $lists['ea_hotfpa']; ?></td>
        	<td>&nbsp;</td>
		</tr>
		<tr>
       		<td> <?php echo _EAB_CFG_POSITION_HOT_FP; ?></td>
        	<td><?php echo $lists['ea_hotfp_pos']; ?></td>
        	<td>&nbsp;</td>
		</tr>
	   	<tr>
			<script language="javascript" >
			function refreshcolor(){
							
				inbox  = document.adminForm.ea_hot_color
				inbox.style.color=inbox.value;			
			}
			</script>
       		<td><?php echo _EAB_CFG_HOTCOLOR; ?></td>
	       	<td colspan="2"><input style='color:<?php echo $lists['ea_hot_color']?>;' name="ea_hot_color" type="text" value="<?php echo $lists['ea_hot_color'] ?>" size="7" maxlength="7"
			 id="bau" onclick="startColorPicker(this)" onkeyup="maskedHex(this)" />
			
		</td>
        </tr>
		<tr>
       		<td><?php echo _EAB_CFG_SHOWLOCATION; $tip=_EAB_CFG_LOCATIONREQUIRED; echo mosToolTip(htmlentities($tip,ENT_QUOTES,"UTF-8")); ?></td>
        	<td><?php echo $lists['ea_fulllocation']; ?></td>
			<td></td>
        </tr>
        <tr>
       		<td><?php echo _EAB_CFG_STS154; ?></td>
        	<td><input name="ea_shortinfo" type="text" value="<?php echo $lists['ea_shortinfo'] ?>" /></td>
        	<td>(valid values are : town,district,locstate,value,obj_id  separate them with a comma "," )</td>
		</tr>	
    	<tr>
     		<td><?php echo _EAB_CFG_STS21; ?></td>
        	<td><?php echo $lists['ea_perpage']; ?></td>
        	<td>&nbsp;</td>
    	</tr>
		<tr>
       		<td><?php echo _EAB_CFG_MAILTOFRIEND; ?></td>
        	<td colspan="2"><?php echo $lists['ea_mtf']; ?></td>
        </tr>
		<tr>
       		<td><?php echo _EAB_CFG_PRINTBTN; ?></td>
        	<td colspan="2"><?php echo $lists['ea_print']; ?></td>
        </tr>
		<tr>
      		<td width="20%"><?php echo "Enable Captcha Security Images?"; ?></td>
        	<td width="45%"><?php echo $lists['ea_captcha']; ?></td>
        	
    	</tr>
		
		</table>
    	<?php
    	backendFooter();
		$tabs->endTab();
    	$tabs->startTab(_EAB_CFG_SEARCH, "search-page");
    	?>
		<table width="100%" border="0" cellspacing="0" cellpadding="4" class="adminform">
		<tr>
	    	<th class="title" colspan="3">&nbsp;</th>
        </tr>    	
    	<tr>
       		<td width="20%" valign="top"><?php echo _EAB_CFG_FREESEARCH; ?></td>
        	<td width="45%" ><?php echo $lists['ea_f_srch']; ?></td>
        	<td width="35%">&nbsp;</td>
    	</tr>
		<tr>
       		<td valign="top"><?php echo _EAB_CFG_STS27; ?></td>
        	<td><?php echo $lists['ea_l_srch']; ?></td>
        	<td>&nbsp;</td>
    	</tr>
		<tr>
       		<td valign="top">&nbsp;'-&#062;<?php echo _EAB_CFG_LOC_SRCHTYPE; ?></td>
        	<td><?php echo $lists['ea_loc_srchtype']; ?></td>
        	<td>&nbsp;</td>
    	</tr>
    	<tr>
       		<td valign="top"><?php echo _EAB_CFG_STS271; ?></td>
        	<td><?php echo $lists['ea_d_srch']; ?></td>
        	<td>&nbsp;</td>
    	</tr>
		
		</table>
    	<?php
    	backendFooter();
		$tabs->endTab();    	
    	$tabs->startTab(_EAB_CFG_IMAGES, "img-page");
    	?>
		<table width="100%" border="0" cellspacing="0" cellpadding="4" class="adminform">
    	<tr>
			<th class="title" colspan="3">&nbsp;</th>
        </tr> 
    	<tr>
    		<td width="25%"><?php echo _EAB_CFG_STS8; ?></td> 
        	<td width="45%"><input type="text" name="ea_picpath" size="50" class="text_area" maxlength="100" value="<?php echo $lists['ea_picpath']; ?>" /></td>
        	<td width="30%"><?php echo _EAB_CFG_PICPATH_STATUS.$lists['picpath_avalaible'] . " / " . $lists['picpath_writeable']; ?></td>
    	</tr>
    	<tr>
       		<td><?php echo _EAB_CFG_MP; ?></td>
        	<td><input type="text" name="ea_maxpics" size="5" class="text_area" maxlength="5" value="<?php echo $lists['ea_maxpics']; ?>" />&nbsp;<?php echo _EAB_CFG_ZERODISABLE?></td>
       		<td>&nbsp;</td>
    	</tr>
    	<tr>
       		<td><?php echo _EAB_CFG_STS10; ?></td>
        	<td><input type="text" name="ea_maxpicsize" size="7" class="text_area" maxlength="50" value="<?php echo $lists['ea_maxpicsize']; ?>" />&nbsp;KB&nbsp;&nbsp;
        			<span class="small">(PHP.ini Limit = <?php echo ini_get( 'post_max_size' );?>)</span></td>
       		<td>&nbsp;</td>
    	</tr>    	
    	<tr>
       		<td><?php echo _EAB_CFG_STS11; ?></td>
        	<td><?php echo $lists['ea_gplib']; ?>&nbsp;&nbsp;<?php $tip = _EAB_CFG_GDINFO; echo mosToolTip(htmlentities($tip,ENT_QUOTES,"UTF-8")); ?></td>
        	<td>&nbsp;</td>
    	</tr>
    	<tr>
    		<td colspan="3"><div style="border-bottom-color:#919B9C; border-bottom-style: solid; border-width:1px;text-align:center; width:auto; height:3px;"></div></td>
    	</tr>
    	<tr>
       		<td valign="top"><?php echo _EAB_CFG_STS112; ?></td>
        	<td><input type="text" name="ea_imgwidth" size="5" class="text_area" maxlength="5" value="<?php echo $lists['ea_imgwidth']; ?>" /> (Width)&nbsp;
  					<input type="checkbox" name="ea_imgprtn" value="1" <?php echo $lists['ea_imgprtn']; ?> /><?php echo _EAB_CFG_PROPORTIONS;?><br />
        			<input type="text" name="ea_imgheight" size="5" class="text_area" maxlength="5" value="<?php echo $lists['ea_imgheight']; ?>" /> (Heigth)</td>
        	<td>&nbsp;</td>
    	</tr>
    	<tr>
       		<td><?php echo _EAB_CFG_STS114; ?></td>
        	<td><input type="text" name="ea_imgqulty" size="5" class="text_area" maxlength="5" value="<?php echo $lists['ea_imgqulty']; ?>" />&nbsp;%</td>
       		<td>&nbsp;</td>
    	</tr>
		<tr>
       		<td><?php echo _EAB_CFG_WATERMARK; ?></td>
        	<td><?php echo $lists['ea_watermark']; ?></td>
       		<td>&nbsp;</td>
    	</tr>       
    	<tr>
    		<td colspan="3"><div style="border-bottom-color:#919B9C; border-bottom-style: solid; border-width:1px;text-align:center; width:auto; height:3px;"></div></td>
    	</tr>
    	<tr>
       		<td valign="top"><?php echo _EAB_CFG_STS12; ?></td>
        	<td><input type="text" name="ea_tbwidth" size="5" class="text_area" maxlength="5" value="<?php echo $lists['ea_tbwidth']; ?>" /> (Width)&nbsp;
  					<input type="checkbox" name="ea_tbprtn" value="1" <?php echo $lists['ea_tbprtn']; ?> /><?php echo _EAB_CFG_PROPORTIONS;?><br />
        			<input type="text" name="ea_tbheight" size="5" class="text_area" maxlength="5" value="<?php echo $lists['ea_tbheight']; ?>" /> (Heigth)</td>
        	<td>&nbsp;</td>
    	</tr>
    	<tr>
       		<td><?php echo _EAB_CFG_STS13; ?></td>
        	<td><input type="text" name="ea_tbqulty" size="5" class="text_area" maxlength="5" value="<?php echo $lists['ea_tbqulty']; ?>" />&nbsp;%</td>
       		<td>&nbsp;</td>
    	</tr>
    	 <tr>
    		<td colspan="3"><div style="border-bottom-color:#919B9C; border-bottom-style: solid; border-width:1px;text-align:center; width:auto; height:3px;"></div></td>
    	</tr>   	
		
		<tr>
       		<td>Repair:</td>
        	<td><input value="Fix GIF/PNG" type="button" onClick="window.location='<?php echo ampReplace('index2.php?option=com_estateagent&act=galleryRepair&task=fixgifpng');?>'"/><br/>
			<input value="Remove nonexistant image records" type="button"  onClick="window.location='<?php echo ampReplace('index2.php?option=com_estateagent&act=galleryRepair&task=cleardb');?>'"/><br/>
			<input value="Remove unlinked images" type="button" onClick="window.location='<?php echo ampReplace('index2.php?option=com_estateagent&act=galleryRepair&task=clearfiles');?>'"/><br/>
			<input value="Recreate Thumbnails" type="button" onClick="window.location='<?php echo ampReplace('index2.php?option=com_estateagent&act=galleryRepair&task=fixthumbs');?>'"/><br/>
			</td>
        	<td>&nbsp;</td>
    	</tr>
    	</table>
    	<?php
    	backendFooter();
		$tabs->endTab();

			$tabs->startTab("FrontEnd", "frontend-page");
    		?>
    		<table width="100%" border="0" cellspacing="0" cellpadding="4" class="adminform">
    		<tr>
	    		<th class="title" colspan="3">&nbsp;</th>
        	</tr>  
    		<tr>
				<td width="20%"> <?php echo _EAB_CFG_FRONTEND_ADMIN; ?></td>
        		<td width="45%"><?php echo $lists['ea_allowsubmission'];?></td>
       			<td width="35%">&nbsp;</td>
			</tr>
			<tr>
			  <td><?php echo _EAB_CFG_FRONTEND_ACCESS_LEVEL; ?></td>
			  <td><?php echo $lists['frontaccess'];?></td>
			  <td>&nbsp;</td>
			  </tr>
			<tr>
			  <td><?php echo _EAB_CFG_FRONTEND_SUPER_VISOR;?> </td>
			  <td><?php echo $lists['frontsuper'];?></td>
			  <td>&nbsp;</td>
			  </tr>
			<tr>
			  <td><?php echo _EAB_CFG_NON_SUPER_VISOR_PUBLISH;?></td>
			  <td><?php echo $lists['allowpublish'];?></td>
			  <td>&nbsp;</td>
			  </tr>
			<tr>
			  <td><?php echo _EAB_CFG_MAX_OBJECTS_PER_USER;?> </td>
			  <td><input type="text" name="ea_maxobjects" size="5" class="text_area" maxlength="5" value="<?php echo $lists['maxobjects']; ?>" />&nbsp;<?php echo _EAB_CFG_ZERODISABLE?> </td>
			  <td>&nbsp;</td>
			  </tr>
              <tr>
               <td><?php echo _EAB_CFG_SENDMAIL?> </td>
			  <td><?php echo $lists['mail'];?></td>
			  <td>&nbsp;</td>
			  </tr>
			 
    		</table>
    		<?php    	
    		backendFooter();
			$tabs->endTab();    	

		$tabs->startTab(_EAB_CFG_MAP24, "map24-page");
    	?>
    	<table width="100%" border="0" cellspacing="0" cellpadding="4" class="adminform">
    	<tr>
	    	<th class="title" colspan="3">&nbsp;</th>
        </tr>  
    	<tr>
       		<td width="20%"><?php echo _EAB_CFG_MAP24_SPRT; ?></td>
        	<td width="45%"><?php echo $lists['ea_map24']; ?></td>
        	<td width="35%"><?php $tip=_EAB_CFG_MAP24_INFO1; echo mosToolTip(htmlentities($tip,ENT_QUOTES,"UTF-8")); ?></td>
    	</tr> 
        <tr>
       		<td><?php echo _EAB_CFG_MAP24_LID; ?></td>
        	<td><input type="text" name="ea_map24_lid" size="10" class="text_area" maxlength="50" value="<?php echo $lists['ea_map24_lid']; ?>" /></td>
        	<td><?php echo _EAB_CFG_MAP24_INFO2;?></td>
    	</tr>
    	<tr>
       		<td><?php echo _EAB_CFG_MAP24_MAP; ?></td>
        	<td><?php echo $lists['ea_map24_type']; ?></td>
        	<td>&nbsp;</td>
    	</tr>
    	<tr>
       		<td><?php echo _EAB_CFG_MAP24_LGV; ?></td>
        	<td><?php echo $lists['ea_map24_dlg']; ?></td>
        	<td><?php $tip=_EAB_CFG_MAP24_INFO3; echo mosToolTip(htmlentities($tip,ENT_QUOTES,"UTF-8")); ?></td>
    	</tr>
    	<tr>
       		<td><?php echo _EAB_CFG_MAP24_GTD; ?></td>
        	<td><input type="text" name="ea_map24_dinfo" size="50" class="text_area" maxlength="100" value="<?php echo $lists['ea_map24_dinfo']; ?>" /></td>
        	<td>&nbsp;</td>
    	</tr>
    	<tr>
       		<td><?php echo _EAB_CFG_MAP24_TLOGO; ?></td>
        	<td><input type="text" name="ea_map24_tlogo" size="50" class="text_area" maxlength="120" value="<?php echo $lists['ea_map24_tlogo']; ?>" /></td>
        	<td><?php $tip=_EAB_CFG_MAP24_INFO4; echo mosToolTip(htmlentities($tip,ENT_QUOTES,"UTF-8")); ?></td>
    	</tr>
		<tr>
       		<td><?php echo _EAB_CFG_MAP24_LIMG; ?></td>
        	<td><input type="text" name="ea_map24_dimg" size="50" class="text_area" maxlength="120" value="<?php echo $lists['ea_map24_dimg']; ?>" /></td>
        	<td><?php $tip=_EAB_CFG_MAP24_INFO5; echo mosToolTip(htmlentities($tip,ENT_QUOTES,"UTF-8")); ?></td>
    	</tr>
		
		
    	</table>
    	<?php
    	backendFooter();
    	$tabs->endTab();
    	$tabs->startTab(_EAB_CFG_MISC, "misc-page");
    	?>
		<table width="100%" border="0" cellspacing="0" cellpadding="4" class="adminform">
    	<tr>
			<th class="title" colspan="3">&nbsp;</th>
        </tr>
		<tr>
			<td width="20%"><?php echo _EAB_CFG_MTGC;?></td>
			<td width="45%"><?php echo $lists['ea_mtgcalc'];?></td>
			<td width="35%">&nbsp;</td>
		</tr>
		<tr>
			<td colspan="3"><b><?php echo _EAB_CFG_MTG;?></b></td>
        </tr>
		<tr>
			<td><?php echo _EAB_CFG_MTGC_DEF_INT_PERCNT;?></td>
			<td><input type="text" name="ea_mtg_default_interest_percent" size="4" class="text_area" maxlength="4" value="<?php echo $lists['ea_mtg_default_interest_percent']; ?>" />&nbsp;%</td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td><?php echo _EAB_CFG_MTGC_DEF_YEAR_TERM;?></td>
			<td><input type="text" name="ea_mtg_default_year_term" size="4" class="text_area" maxlength="3" value="<?php echo $lists['ea_mtg_default_year_term']; ?>" />&nbsp;<?php echo _EAB_CFG_MTGC_YEARS;?></td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td><?php echo _EAB_CFG_MTGC_DEF_DOWN_PERCNT;?></td>
			<td><input type="text" name="ea_mtg_default_down_percent" size="4" class="text_area" maxlength="4" value="<?php echo $lists['ea_mtg_default_down_percent']; ?>" />%</td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td><?php echo _EAB_CFG_MTGC_DEF_SHOW_PROGRESS;?></td>
			<td><?php echo $lists['ea_mtg_default_show_progress'];?></td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td colspan="3">&nbsp;</td>
		</tr>
			
		</table>
    	<?php
    	backendFooter();
    	$tabs->endTab();
		$base=dirname(__FILE__);
		$base=$base.DIRECTORY_SEPARATOR;
		if(file_exists($base."classes/gmap.estateagent.php"))
		{
		$tabs->startTab("GoogleMap", "google-page");
		?>
		<table width="99%" border="0" cellspacing="1" cellpadding="0" class="adminform">
		<tr>        <th class="title" colspan="3">&nbsp;</th></tr>
  <tr>
    <td><?php echo _EAB_CFG_GOOGLEMAP_ENABLE;?></td>
    <td><?php echo $lists['googlemap_enable']?></td>
	<td><?php echo _EAB_CFG_GOOGLEMAP_EXPLANATION1;?></td>
  </tr>
  <tr>
    <td><?php echo _EAB_CFG_GOOGLEMAP_KEY; ?> </td>
    <td>
      <input name="ea_googlemap_key" type="text" size="50"  value="<?php echo $eaconf->ea_googlemap_key; ?>" /></td>
	<td><?php echo _EAB_CFG_GOOGLEMAP_GET_KEY;?></td>
  </tr>
  <tr>
    <td><?php echo _EAB_CFG_GOOGLEMAP_SITE_MARK;?></td>
    <td> <input name="ea_googlemap_sitemark" type="text" size="50"  value="<?php echo $eaconf->ea_googlemap_sitemark ?>"  onclick="showLocation(this.value);" onchange="showLocation(this.value);" onblur="showLocation(this.value);" /></td>
	<td><?php echo _EAB_CFG_GOOGLEMAP_EXPLANATION2;?></td>
  </tr>
  <tr>
    
	<td>&nbsp;</td>
	<td>&nbsp;</td>
	<td>&nbsp;</td>
  </tr>
  <tr><td colspan="3" align="center"><?php 
  if($eaconf->ea_googlemap_enable==1)
	  GMapFunctions::configPane($eaconf->ea_googlemap_sitemark);
	  
	  
  ?></td></tr>
   
  
</table>


		
		
		<?php
			
		backendFooter();
		$tabs->endTab();
		}//(googlemap exists)
		
		$tabs->endPane();
		

    	?>
		</form>
    <?php
 }

// *****************************************************************************************
// Start Show Info *************************************************************************
// *****************************************************************************************

 function showEAinfo(){
		global $mosConfig_live_site, $ea_version, $mosConfig_absolute_path;

		?>
		
		<table width="100%" border="0" >
        <?php //backendMenu();?>
 			<tr >
        		<td colspan="2" width="100%">
             		<?php include( $mosConfig_absolute_path."/administrator/components/com_estateagent/info.estateagent.php");?>
					
         	</td></tr>
      		<tr><td colspan="2" align="center"><?php backendFooter();?></td></tr>
 		</table>
       
		
 <?php
 }

}
?>
